package TextEditor.facade;

import javax.swing.JLabel;
import javax.swing.JTextArea;

import TextEditor.FileCutPaste;
/**
 * Implements Facade design pattern. Represents a Facade
 */
public class FileKeeper {

	public void getOperation(JTextArea textArea, String type, JLabel infoStatus) throws Exception{
	
		if (type.equals("Copy")){
			CopyOperation cpp = new CopyOperation();
			cpp.fileOperation(textArea);
		}
		else if (type.equals("Cut")){
			CutOperation cop = new CutOperation();
			cop.fileOperation(textArea);
		}
		else if (type.equals("Paste")){
			PasteOperation pop = new PasteOperation();
			pop.fileOperation(textArea);
		}
		else if (type.equals("Additive Copy")){
			AdditiveCopyOpertion addCpp = new AdditiveCopyOpertion();
			addCpp.fileOperation(textArea);
		}
		else if (type.equals("Additive Cut")){
			AdditiveCutOperation addCut = new AdditiveCutOperation();
			addCut.fileOperation(textArea);
		}
		else if (type.equals("Search")){
			
		}

		else{
			throw new Exception("\"" + type + "\"" + " command is invalid!");
			
		}
		
	}
}
